module.exports = (req, res, next) ->
  res.header 'Access-Control-Allow-Origin', '*'
  res.header 'Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS'
  res.header 'Access-Control-Allow-Headers', 'Content-Type'
  res.header 'Access-Control-Max-Age', '1728000'
  if req.method.toLowerCase() is 'options'
    res.send(200)
    return res.end()
  next()
